{extend name='Public/main'/}
{block name='body'}
<link rel="stylesheet" type="text/css" href="__PUBLIC__/theme/css/login.css" media="all">
<div class="main">
    <div class="login">
        <!--<h1>管理系统</h1>-->
        <div class="inset">
            <!--start-main-->
            <form class="layui-form">
                <div>
                    <h2>管理登录</h2>
                    <span>
                        <input type="text" name="username" value="" placeholder="用户名" class="username" lay-verify="required" autofocus="autofocus"/>
                    </span>
                </div>
                <div>
                    <span>
                        <input type="password" name="password" placeholder="密码" class="password" lay-verify="required"/>
                    </span>
                </div>
                <div id="verify">
                    <span>
                        <input type="text" name="captcha" placeholder="验证码" class="verify" lay-verify="required"/>
                        <img src="{:U('Login/verify')}" id="code_img" onclick="this.src = '__URL__/verify/' + Math.random()">
                    </span>
                </div>
                <div class="sign">
                    <input type="button" lay-submit lay-filter="submit" value="登录" class="submit" />
                </div>
            </form>
        </div>
    </div>
    <!--//end-main-->
</div>

<div class="copy-right">
    <!--<p><a target="_blank" href="http://www.cktwl.com/">&copy; 2018 cktwl Login Form. All Rights Reserved</a></p>-->
</div>
{/block}
{block name='script'}
<script>
    if (window.location.href.indexOf('#') > -1) {
        window.location.href = window.location.href.split('#')[0];
    }
    $(document).keyup(function(event) {
        if (event.keyCode == 13) {
            $(".submit").trigger("click");
        }
    });
    /*! 表单提交 */
    form.on('submit(submit)', function(obj) {
        var _form = obj.form;
        var url = $(_form).attr('action');
        $.post(url, $(_form).serialize(), function(data) {
            showTip(data)
        });
    });
</script>
{/block}